package com.yanggu.scala.chapater12.caseclass

import CaseClassDemo01.Currency

object CaseClassDemo03 {

  def main(args: Array[String]): Unit = {
    //样例类的copy方法使用。这里copy方法会将原有样例类的属性全部复制一遍。
    //且生成一个全新的类
    val currency = Currency(3000.0, "RMB")
    val currency1 = currency.copy(value = 2000.0)
    println(currency1.hashCode())
    println(currency1)
    println(currency)
    println(currency.hashCode())
  }

}
